package com.ag.oa.core.service.impl;

import com.ag.oa.core.dao.ISkillDao;
import com.ag.oa.core.entity.vo.SkillVO;
import com.ag.oa.core.service.ISkillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("skillServiceImpl")
public class SkillServiceImpl implements ISkillService {

    @Autowired
    private ISkillDao skillDao;

    @Override
    public List<SkillVO> getUserAllWorkSkills(Integer userId) {

        return skillDao.getAllWorkSkillByUserId(userId);
    }

    @Override
    public SkillVO getWorkSkillInfoData(Integer id) {

        return skillDao.getById(id);
    }

    @Override
    public void saveUserWorkSkill(SkillVO skillVO) {

        if (skillVO.getId()==null) {
            skillDao.saveAddWorkSkill(skillVO);
        } else {
            skillDao.updateWorkSkill(skillVO);
        }
    }

    @Override
    public void delUserWorkSkill(Integer id) {

        skillDao.delWorkSkill(id);
    }

}
